{php include wl_template('common/header');}
<ul class="nav nav-tabs">
	<li ><a href="javascript:;">添加权益</a></li>
</ul>
<div class="app-content">
	<div class="app-form">
		<form action="" method="post" class="form-horizontal form" enctype="multipart/form-data">
			<input type="hidden" name="id" value="{$nav['id']}" />
			<div class="panel panel-default">
				<div class="panel-heading">
					会员权益设置
				</div>
				<div class="panel-body">
					<div class="form-group">
						<label class="col-sm-2 control-label">排序</label>
						<div class="col-sm-9">
							<input type="text" name="nav[displayorder]" placeholder="默认排序为0" class="form-control" value="{$nav['displayorder']}" >
						</div>
					</div>
					<div class="form-group">
						<label class="col-sm-2 control-label">权益标题<span class="must-fill">*</span></label>
						<div class="col-sm-9">
							<input type="text" name="nav[name]" required class="form-control" value="{$nav['name']}" >
						</div>
					</div>
					<div class="form-group">
						<label class="col-sm-2 control-label">标题颜色</label>
						<div class="col-sm-9">
							<div class="input-group">
								<input type="color" name="nav[color]" required id="color" value="{$nav['color']}" class="form-control">
								<span id="reset" class="input-group-addon btn btn-default">重置</span>
							</div>
						</div>
					</div>
					<div class="form-group">
						<label class="col-sm-2 control-label">权益缩略图<span class="must-fill">*</span></label>
						<div class="col-sm-9">
							{php echo attachment_select('nav[thumb]', $nav['thumb'])}
							<span class="help-block">建议图片大小80*80</span>
						</div>
					</div>
					<div class="form-group">
						<label class="col-sm-2 control-label">权益连接</label>
						<div class="col-sm-9">
							<div class="input-group">
								<input type="text" value="{$nav['link']}" readonly="readonly" class="form-control valid" name="link" placeholder="" id="advlink">
								<span data-input="#advlink" data-toggle="selectUrl" class="input-group-addon btn btn-default">选择链接</span>
							</div>
							<span class="help-block">不填则跳转到用户权益说明页面</span>
						</div>
					</div>
					<div class="form-group">
			    		<label class="col-sm-2 control-label">是否显示</label>
			    		<div class="col-sm-9">
			    			<label class="radio-inline">
                                <input type="radio" value="1" name="enabled" {if $nav['enabled']==1}checked{/if}>是
                            </label>
                            <label class="radio-inline">
                                <input type="radio" value="0" name="enabled" {if $nav['enabled']==0}checked{/if}>否
                            </label>
			    		</div>
			  		</div>
				</div>
			</div>
			<div class="form-group">
				<label class="col-sm-2 control-label"></label>
				<div class="col-sm-9">
					<input type="submit" name="submit" value="提交" class="btn btn-primary min-width" />
					<input type="hidden" name="token" value="{$_W['token']}" />
				</div>
			</div>
		</form>
	</div>
</div>
<script>
	$('input[name="nav[thumb]"]').attr('required','required');

	$("#reset").on('click',function(){
		$("#color").val('#333').trigger('propertychange');
	});
</script>
{php include wl_template('common/footer');}